From 96fcdfd91ab6230a38c54d3baca14ed92fb333c4 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 13 Jul 2006 03:27:52 +0000 Subject: [PATCH] Andy Armstrong turns on -Wall for GCC builds and kills about a sequillion warnings. Most of them aren't "real", but it's still a good thing to clean up. (I hope I don't regret this before 1.3.1...) --- an1.c | 11 +- axim_gpb.c | 3 +- brauniger_iq.c | 6 +- cet_util.c | 1 - coastexp.c | 2 +- coldsync/pdb.c | 54 +- configure | 34 +- configure.in | 4 + csv_util.c | 3 + cvttypes.c | 5 +- delgpl.c | 4 +- garmin.c | 16 +- gbser_posix.c | 4 - gdb.c | 3 +- geo.c | 1 - geoniche.c | 2 + google.c | 2 - gpilots.c | 2 +- gpssim.c | 3 +- gpx.c | 5 +- gtm.c | 3 + html.c | 2 +- interpolate.c | 4 +- jeeps/gpslibusb.c | 2 +- jeeps/gpsusbstub.c | 2 + kml.c | 1 - lowranceusr.c | 3 +- magproto.c | 3 +- mapsource.c | 21 +- msroute.c | 17 +- msvc/GPSBabel.vcproj | 4247 ++++++++++++++++++++++++------------------ msvc/config.h | 2 +- navicache.c | 2 +- pathaway.c | 9 +- polygon.c | 8 + position.c | 2 +- psitrex.c | 12 +- psp.c | 3 +- quovadis.c | 4 +- shape.c | 2 +- shapelib/dbfopen.c | 10 +- shapelib/shpopen.c | 10 +- strptime.c | 8 +- tpg.c | 3 +- tpo.c | 5 +- unicsv.c | 4 +- util.c | 22 +- vecs.c | 2 +- wbt-200.c | 12 +- wfff_xml.c | 2 +- xmlgeneric.c | 4 +- yahoo.c | 2 +- 52 files changed, 2581 insertions(+), 2017 deletions(-) diff --git a/an1.c b/an1.c index e47af08d7..e86ed61b4 100644 --- a/an1.c +++ b/an1.c @@ -217,12 +217,6 @@ EncodeOrd( double ord ) return (gbint32)(0x80000000 - (gbint32)(ord * 0x800000)); } -static int -IsGuidEqual( GUID *a, GUID *b ) -{ - return !memcmp( a, b, sizeof( GUID )); -} - typedef struct { short hotspotxhi; long hotspoty; @@ -752,7 +746,6 @@ Write_One_AN1_Waypoint( const waypoint *wpt ) an1_waypoint_record *rec; int local; format_specific_data *fs = NULL; - waypoint *wpt2 = (waypoint *)(void *)wpt; fs = fs_chain_find( wpt->fs, FS_AN1W ); if ( fs ) { @@ -865,7 +858,7 @@ static void Read_AN1_Lines( FILE *f ) { wpt_tmp->latitude = DecodeOrd( vert->lat ); wpt_tmp->longitude = -DecodeOrd( vert->lon ); wpt_tmp->shortname = (char *) xmalloc(7); - sprintf( wpt_tmp->shortname, "\\%5.5x", rtserial++ ); + sprintf( wpt_tmp->shortname, "\\%5.5lx", rtserial++ ); fs_chain_add( &wpt_tmp->fs, (format_specific_data *)vert ); route_add_wpt(rte_head, wpt_tmp); @@ -900,7 +893,6 @@ Write_One_AN1_Line( const route_head *rte ) an1_line_record *rec; int local; format_specific_data *fs = NULL; - route_head *rte2 = (route_head *)(void *)rte; fs = fs_chain_find( rte->fs, FS_AN1L ); @@ -999,7 +991,6 @@ Write_One_AN1_Vertex( const waypoint *wpt ) an1_vertex_record *rec; int local; format_specific_data *fs = NULL; - waypoint *wpt2 = (waypoint *)(void *)wpt; fs = fs_chain_find( wpt->fs, FS_AN1V ); diff --git a/axim_gpb.c b/axim_gpb.c index 49103be37..90fe552b5 100644 --- a/axim_gpb.c +++ b/axim_gpb.c @@ -29,8 +29,7 @@ #define RECORD_LEN 344 -static FILE *fin, *fout; -static char dbginfo = 1; +static FILE *fin; static arglist_t axim_gpb_args[] = { diff --git a/brauniger_iq.c b/brauniger_iq.c index 9bfb39423..41759c1fd 100644 --- a/brauniger_iq.c +++ b/brauniger_iq.c @@ -22,7 +22,7 @@ #include "jeeps/gpsserial.h" #include -static int32 fd; +/*static int32 fd;*/ static char *port; #define MYNAME "BRAUNIGER-IQ" @@ -30,6 +30,7 @@ static char *port; #define GPS_Serial_On(a, b) 0 #define GPS_Serial_Off(a, b) 0 +#if 0 static enum { st_sync, st_fl_num, @@ -51,6 +52,7 @@ static enum { } state; static const int reqd_bytes[num_states] = { 6, 1, 2, 2, 25, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1 }; +#endif static void rd_init(const char *fname) { @@ -77,6 +79,7 @@ static void rd_deinit(void) xfree(port); } +#if 0 /** * Process a data record. * @return zero when all expected data has been received @@ -229,6 +232,7 @@ static int process_data(const unsigned char *data) state++; return remaining; } +#endif static void data_read(void) { diff --git a/cet_util.c b/cet_util.c index a6b74d66b..5565ff22a 100644 --- a/cet_util.c +++ b/cet_util.c @@ -865,7 +865,6 @@ cet_deregister(void) int cet_validate_cs(const char *cs, cet_cs_vec_t **vec, char **cs_name) { - char buff[128]; cet_cs_vec_t *v; if ((cs == NULL) || (strlen(cs) == 0)) /* set default us-ascii */ diff --git a/coastexp.c b/coastexp.c index 7c412e2ba..3af5b093d 100755 --- a/coastexp.c +++ b/coastexp.c @@ -338,7 +338,7 @@ ce_read(void) while ((len = fread(buf, 1, sizeof(buf), fd))) { if (!XML_Parse(psr, buf, len, feof(fd))) { fatal(MYNAME ":Parse error at %d: %s\n", - XML_GetCurrentLineNumber(psr), + (int) XML_GetCurrentLineNumber(psr), XML_ErrorString(XML_GetErrorCode(psr))); } } diff --git a/coldsync/pdb.c b/coldsync/pdb.c index 9253a9038..161efc64c 100644 --- a/coldsync/pdb.c +++ b/coldsync/pdb.c @@ -6,7 +6,7 @@ * You may distribute this file under the terms of the Artistic * License, as specified in the README file. * - * $Id: pdb.c,v 1.11 2006/05/07 02:14:35 robertl Exp $ + * $Id: pdb.c,v 1.12 2006/07/13 03:27:53 robertl Exp $ */ /* XXX - The way zero-length records are handled is a bit of a kludge. They * shouldn't normally exist, with the exception of expunged records. But, @@ -561,7 +561,7 @@ pdb_Write(const struct pdb *db, _("\"%.*s\" record 0x%08lx has " "length 0.\n"), PDB_DBNAMELEN, db->name, - rec->id); + (unsigned long) rec->id); } put_udword(&wptr, offset); @@ -972,7 +972,7 @@ new_Record(const ubyte flags, fprintf(stderr, "new_Record: Creating new record:\n"); fprintf(stderr, "\tflags == 0x%02x\n", flags); fprintf(stderr, "\tcategory == 0x%02x\n", category); - fprintf(stderr, "\tid == 0x%08lx\n", id); + fprintf(stderr, "\tid == 0x%08lx\n", (unsigned long) id); fprintf(stderr, "\tlen == %d\n", len); debug_dump(stderr, "NEW", data, len); } @@ -1038,12 +1038,12 @@ new_Resource(const udword type, { fprintf(stderr, "new_Resource: Creating new resource:\n"); fprintf(stderr, "\ttype == 0x%08lx (%c%c%c%c)\n", - type, + (unsigned long) type, (int) ((type >> 24) & 0xff), (int) ((type >> 16) & 0xff), (int) ((type >> 8) & 0xff), (int) (type & 0xff)); - fprintf(stderr, "\tid == 0x%04x\n", id); + fprintf(stderr, "\tid == 0x%04x\n", (unsigned) id); fprintf(stderr, "\tlen == %d\n", len); debug_dump(stderr, "NEW", data, len); } @@ -1272,32 +1272,33 @@ pdb_LoadHeader(int fd, fprintf(stderr, "\n"); fprintf(stderr, "\tversion: %u\n", db->version); t = db->ctime - EPOCH_1904; - fprintf(stderr, "\tctime: %lu %s", db->ctime, + fprintf(stderr, "\tctime: %lu %s", (unsigned long) db->ctime, ctime(&t)); t = db->mtime - EPOCH_1904; - fprintf(stderr, "\tmtime: %lu %s", db->mtime, + fprintf(stderr, "\tmtime: %lu %s", (unsigned long) db->mtime, ctime(&t)); t = db->baktime - EPOCH_1904; - fprintf(stderr, "\tbaktime: %lu %s", db->baktime, + fprintf(stderr, "\tbaktime: %lu %s", (unsigned long) db->baktime, ctime(&t)); - fprintf(stderr, "\tmodnum: %ld\n", db->modnum); + fprintf(stderr, "\tmodnum: %lu\n", (unsigned long) db->modnum); fprintf(stderr, "\tappinfo_offset: 0x%08lx\n", - db->appinfo_offset); + (unsigned long) db->appinfo_offset); fprintf(stderr, "\tsortinfo_offset: 0x%08lx\n", - db->sortinfo_offset); + (unsigned long) db->sortinfo_offset); fprintf(stderr, "\ttype: '%c%c%c%c' (0x%08lx)\n", (char) (db->type >> 24) & 0xff, (char) (db->type >> 16) & 0xff, (char) (db->type >> 8) & 0xff, (char) db->type & 0xff, - db->type); + (unsigned long) db->type); fprintf(stderr, "\tcreator: '%c%c%c%c' (0x%08lx)\n", (char) (db->creator >> 24) & 0xff, (char) (db->creator >> 16) & 0xff, (char) (db->creator >> 8) & 0xff, (char) db->creator & 0xff, - db->creator); - fprintf(stderr, "\tuniqueIDseed: %ld\n", db->uniqueIDseed); + (unsigned long) db->creator); + fprintf(stderr, "\tuniqueIDseed: %lu\n", + (unsigned long) db->uniqueIDseed); } return 0; /* Success */ @@ -1329,7 +1330,7 @@ pdb_LoadRecListHeader(int fd, PDB_TRACE(6) { - fprintf(stderr, "\tnextID: %ld\n", db->next_reclistID); + fprintf(stderr, "\tnextID: %ld\n", (long) db->next_reclistID); fprintf(stderr, "\tlen: %u\n", db->numrecs); } @@ -1403,9 +1404,9 @@ pdb_LoadRsrcIndex(int fd, (char) (rsrc->type >> 16) & 0xff, (char) (rsrc->type >> 8) & 0xff, (char) rsrc->type & 0xff, - rsrc->type, + (unsigned long) rsrc->type, rsrc->id, - rsrc->offset); + (unsigned long) rsrc->offset); } /* Append the new resource to the list */ @@ -1504,10 +1505,10 @@ pdb_LoadRecIndex(int fd, "\tRecord %d: offset 0x%08lx, flags 0x%02x, " " category 0x%02x, ID 0x%08lx\n", i, - rec->offset, - rec->flags, + (unsigned long) rec->offset, + (unsigned) rec->flags, rec->category, - rec->id); + (unsigned long) rec->id); /* Append the new record to the database */ pdb_AppendRecord(db, rec); /* XXX - Error-checking */ @@ -1602,7 +1603,7 @@ pdb_LoadAppBlock(int fd, "Expected 0x%lx, but we're at " "0x%lx.\n"), PDB_DBNAMELEN, db->name, - db->appinfo_offset, (long) offset); + (unsigned long) db->appinfo_offset, (unsigned long) offset); } /* Try to recover */ @@ -1715,7 +1716,8 @@ pdb_LoadSortBlock(int fd, "Expected 0x%lx, but we're at " "0x%lx.\n"), PDB_DBNAMELEN, db->name, - db->sortinfo_offset, (long) offset); + (unsigned long) db->sortinfo_offset, + (unsigned long) offset); } /* Try to recover */ @@ -1806,7 +1808,8 @@ pdb_LoadResources(int fd, "at 0x%lx.\n"), i, PDB_DBNAMELEN, db->name, - rsrc->offset, (long) offset); + (unsigned long) rsrc->offset, + (unsigned long) offset); } /* Try to recover */ @@ -1918,7 +1921,7 @@ pdb_LoadRecords(int fd, PDB_TRACE(5) fprintf(stderr, "Reading record %d (id 0x%08lx)\n", - i, rec->id); + i, (unsigned long) rec->id); /* Out of paranoia, make sure we're in the right place. * Since the two NULs may or may not have appeared in the @@ -1939,7 +1942,8 @@ pdb_LoadRecords(int fd, "at 0x%lx.\n"), i, PDB_DBNAMELEN, db->name, - rec->offset, (long) offset); + (unsigned long) rec->offset, + (unsigned long) offset); } /* Try to recover */ diff --git a/configure b/configure index 5fa1ca7c5..dd8c368a2 100755 --- a/configure +++ b/configure @@ -1388,6 +1388,8 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- + + # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2319,6 +2321,22 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking whether ${CC-cc} accepts -Wall" >&5 +echo $ECHO_N "checking whether ${CC-cc} accepts -Wall... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_wall+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -Wall -c conftest.c 2>&1`"; then + ac_cv_prog_cc_wall=yes +else + ac_cv_prog_cc_wall=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_wall" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_wall" >&6 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2679,11 +2697,7 @@ else echo "${ECHO_T}no" >&6 fi - if test "$LIBUSBCONFIG" = false; then - { { echo "$as_me:$LINENO: error: libusb-config not found in $PATH" >&5 -echo "$as_me: error: libusb-config not found in $PATH" >&2;} - { (exit 1); exit 1; }; } - fi; + if test "$LIBUSBCONFIG" = true; then OLDFLAGS=$LDFLAGS OCFLAGS=$CFLAGS LDFLAGS="$LDFLAGS `libusb-config --libs`" @@ -2761,10 +2775,7 @@ _ACEOF USB_CFLAGS="`libusb-config --cflags`" USB_LIBS="`libusb-config --libs`" -else - { { echo "$as_me:$LINENO: error: libusb >= 0.1.8 is needed" >&5 -echo "$as_me: error: libusb >= 0.1.8 is needed" >&2;} - { (exit 1); exit 1; }; } +# ,[AC_MSG_ERROR([libusb >= 0.1.8 is needed])] fi @@ -2781,6 +2792,7 @@ fi OSJEEPS=jeeps/gpslibusb.o CFLAGS="$OCFLAGS" # LIBS="$LIBS `libusb-config --libs`" + fi fi ;; esac @@ -2814,6 +2826,10 @@ else fi; +if test $ac_cv_prog_cc_wall = yes; then + CFLAGS="$CFLAGS -Wall" +fi + if test "x-$xpathdr" != "x-" ; then CFLAGS="$CFLAGS -I$xpathdr" fi diff --git a/configure.in b/configure.in index 029aff458..6bfd7f0e9 100644 --- a/configure.in +++ b/configure.in @@ -23,6 +23,10 @@ AC_CHECK_LIB([m], [cos]) AC_ARG_WITH(cet,[ --with-cet=(default,all,minimal)], cet="$withval", cet="default") +if test $GCC = yes; then + CFLAGS="$CFLAGS -Wall" +fi + if test "$cet" = "all"; then AC_DEFINE(CET_WANTED, 1, [1 for all character sets]) fi diff --git a/csv_util.c b/csv_util.c index 51a90ae30..c485a3f8a 100644 --- a/csv_util.c +++ b/csv_util.c @@ -729,6 +729,8 @@ writetime(char * buff, size_t bufsize, const char * format, time_t t, int gmt ) return strftime(buff, bufsize, format, stmp ); } +#if 0 +/* not used */ static int writeisotime(char * buff, size_t bufsize, const char * format, time_t t) @@ -744,6 +746,7 @@ writeisotime(char * buff, size_t bufsize, const char * format, time_t t) xfree(ibuff); return i; } +#endif static diff --git a/cvttypes.c b/cvttypes.c index 91b114cce..2faeb3b89 100644 --- a/cvttypes.c +++ b/cvttypes.c @@ -2,7 +2,7 @@ Convert data between waypoints, tracks, and routes. - Copyright (C) 2005 Robert Lipe + Copyright (C) 2005, 2006 Robert Lipe This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ static char *action; static route_head *my_trk_head; -time_t tmstart; +static time_t tmstart; static arglist_t cvttype_skeleton_args[] = { @@ -61,6 +61,7 @@ cvttype_skeleton_process(void) wpt->creation_time = ++tmstart; } track_add_wpt(my_trk_head, wpt); + // if action == to rte // waypt_del(wpt); // route_add_wpt(my_rte_head, wpt); diff --git a/delgpl.c b/delgpl.c index cc2c090d1..a3c6cae40 100644 --- a/delgpl.c +++ b/delgpl.c @@ -46,8 +46,8 @@ gpl_rd_init(const char *fname) { gplfile_in = xfopen(fname, "rb", MYNAME); if (sizeof(struct gpl_point) != 56) { - fatal(MYNAME ": gpl_point is %d instead of 56.\n", - sizeof(struct gpl_point)); + fatal(MYNAME ": gpl_point is %lu instead of 56.\n", + (unsigned long) sizeof(struct gpl_point)); } } diff --git a/garmin.c b/garmin.c index 34d53225c..ececa527f 100644 --- a/garmin.c +++ b/garmin.c @@ -364,7 +364,11 @@ route_read(void) int32 nroutepts; int i; GPS_PWay *array; - route_head *rte_head; + /* TODO: Fixes warning but is it right? + * RJL: No, the warning isn't right; GCC's flow analysis is broken. + * still, it's good taste... + */ + route_head *rte_head = NULL; nroutepts = GPS_Command_Get_Route(portname, &array); @@ -381,11 +385,11 @@ route_read(void) case 202: csrc = array[i]->rte_ident; break; default: break; } - rte_head = route_head_alloc(); - route_add_head(rte_head); - if (csrc) { - rte_head->rte_name = xstrdup(csrc); - } + rte_head = route_head_alloc(); + route_add_head(rte_head); + if (csrc) { + rte_head->rte_name = xstrdup(csrc); + } } else { if (array[i]->islink) { continue; diff --git a/gbser_posix.c b/gbser_posix.c index 2f4cd8836..0a54605dd 100644 --- a/gbser_posix.c +++ b/gbser_posix.c @@ -133,10 +133,6 @@ gbser_setspeed(void *handle, unsigned speed) int gbser_read(void *handle, char *ibuf, int size) { - int n; - char *c; - char tbuf[256]; - char *tp = tbuf; gbser_posix_handle *h = (gbser_posix_handle *) handle; ibuf[0] = 0; diff --git a/gdb.c b/gdb.c index 7d04fce2e..28e7751e8 100644 --- a/gdb.c +++ b/gdb.c @@ -1034,7 +1034,8 @@ gdb_fwrite_le(const void *data, const size_t size) break; default: - fatal(MYNAME "-write_le: Unsupported data size (%ld)!\n", size); + fatal(MYNAME "-write_le: Unsupported data size (%lu)!\n", + (unsigned long) size); } } diff --git a/geo.c b/geo.c index 5e5483753..96f9d8d7b 100644 --- a/geo.c +++ b/geo.c @@ -24,7 +24,6 @@ static char *nuke_placer; static waypoint *wpt_tmp; -static FILE *fd; static FILE *ofd; static diff --git a/geoniche.c b/geoniche.c index 79c5737ff..8fda0634f 100644 --- a/geoniche.c +++ b/geoniche.c @@ -609,6 +609,8 @@ wpt2icon(const waypoint *wpt) case gt_cito: return 47; case gt_suprise: return 48; case gt_webcam: return 49; + case gt_unknown: return 0; + case gt_benchmark: return 0; } return 0; diff --git a/google.c b/google.c index 7fcacbde2..8e1872fac 100644 --- a/google.c +++ b/google.c @@ -25,8 +25,6 @@ static char *script = NULL; static route_head *routehead; static short_handle desc_handle; -static FILE *fd; - static int serial = 0; #define MYNAME "google" diff --git a/gpilots.c b/gpilots.c index d15430ba4..b59e2a409 100644 --- a/gpilots.c +++ b/gpilots.c @@ -204,7 +204,7 @@ data_read(void) struct record *rec; struct pdb *pdb; struct pdb_record *pdb_rec; - route_head *track_head; + route_head *track_head = NULL; if (NULL == (pdb = pdb_Read(fileno(file_in)))) { fatal(MYNAME ": pdb_Read failed\n"); diff --git a/gpssim.c b/gpssim.c index f9c66fa87..67cab0dae 100644 --- a/gpssim.c +++ b/gpssim.c @@ -84,7 +84,6 @@ gpssim_wr_deinit(void) static void gpssim_write_sentence(const char *const s) { - int cksum; fprintf(fout, "$%s*%02X\r\n", s, nmea_cksum(s)); } @@ -141,7 +140,7 @@ gpssim_trk_hdr(const route_head *rh) char *ofname = xstrdup(fnamestr); if (fout) { - fatal(MYNAME, ": output file already open.\n"); + fatal(MYNAME ": output file already open.\n"); } snprintf(c, sizeof(c), "%s%04d.gpssim", diff --git a/gpx.c b/gpx.c index 062950bb4..b6bbdfe13 100644 --- a/gpx.c +++ b/gpx.c @@ -1122,7 +1122,8 @@ gpx_rd_init(const char *fname) xsi_schema_loc = xstrdup(DEFAULT_XSI_SCHEMA_LOC); } if (!xsi_schema_loc) { - fatal("gpx: Unable to allocate %d bytes of memory.\n", strlen(DEFAULT_XSI_SCHEMA_LOC) + 1); + fatal("gpx: Unable to allocate %ld bytes of memory.\n", + (unsigned long) strlen(DEFAULT_XSI_SCHEMA_LOC) + 1); } if (NULL == gpx_global) { @@ -1276,7 +1277,7 @@ gpx_read(void) } if (!result) { fatal(MYNAME ": XML parse error at %d: %s\n", - XML_GetCurrentLineNumber(psr), + (int) XML_GetCurrentLineNumber(psr), XML_ErrorString(XML_GetErrorCode(psr))); } } diff --git a/gtm.c b/gtm.c index 86cdce5ea..981b0178a 100644 --- a/gtm.c +++ b/gtm.c @@ -64,6 +64,8 @@ fread_byte(FILE *fd) return buf[0]; } +#if 0 +/* not used */ static short int fread_bool(FILE *fd) { @@ -71,6 +73,7 @@ fread_bool(FILE *fd) fread(buf, 2, 1, fd); return le_read16(buf) ? 1 : 0; } +#endif static short int fread_integer(FILE *fd) diff --git a/html.c b/html.c index fe0b2d765..46874ed55 100644 --- a/html.c +++ b/html.c @@ -105,7 +105,7 @@ html_disp(const waypoint *wpt) fprintf(file_out, "\n"); if (wpt->gc_data.terr) { fprintf(file_out, "

%s

\n", - gs_get_cachetype(wpt->gc_data.type), gs_get_container(wpt->gc_data.container)); + gs_get_cachetype(wpt->gc_data.type)); fprintf(file_out, "

%s\n", gs_get_container(wpt->gc_data.container)); if (wpt->gc_data.desc_short.utfstring) { diff --git a/interpolate.c b/interpolate.c index 00fc66d5b..776513cc7 100644 --- a/interpolate.c +++ b/interpolate.c @@ -53,8 +53,8 @@ interpfilt_process(void) route_head *rte_new; int count = 0; int first = 0; - double lat1, lon1; - int time1; + double lat1 = 0, lon1 = 0; + int time1 = 0; int timen; double distn; double curdist; diff --git a/jeeps/gpslibusb.c b/jeeps/gpslibusb.c index 13a4e9b41..dcaa8bd63 100644 --- a/jeeps/gpslibusb.c +++ b/jeeps/gpslibusb.c @@ -65,7 +65,7 @@ gusb_libusb_send(const garmin_usb_packet *opkt, size_t sz) r = usb_bulk_write(udev, gusb_bulk_out_ep, (char *)(void *)opkt->dbuf, sz, TMOUT_B); if (r != (int) sz) { - fprintf(stderr, "Bad cmdsend r %d sz %d\n", r, sz); + fprintf(stderr, "Bad cmdsend r %d sz %ld\n", r, (unsigned long) sz); if (r < 0) { fatal("usb_bulk_write failed. '%s'\n", usb_strerror()); diff --git a/jeeps/gpsusbstub.c b/jeeps/gpsusbstub.c index 27a31c0cd..d3c640e39 100644 --- a/jeeps/gpsusbstub.c +++ b/jeeps/gpsusbstub.c @@ -21,6 +21,7 @@ #include "config.h" +#include "..\defs.h" #if !HAVE_LIBUSB const char no_usb[] = "USB suport is not available in this build.\n"; @@ -29,6 +30,7 @@ int gusb_init(const char *portname) { fatal(no_usb); + return 0; } #endif /* defined(HAVE_LIBUSB) */ diff --git a/kml.c b/kml.c index 531712ff5..f2c574c5b 100644 --- a/kml.c +++ b/kml.c @@ -37,7 +37,6 @@ static int floating; static waypoint *wpt_tmp; static int wpt_tmp_queued; -static FILE *fd; static FILE *ofd; typedef struct { diff --git a/lowranceusr.c b/lowranceusr.c index 7e4f2a70d..06c553aca 100644 --- a/lowranceusr.c +++ b/lowranceusr.c @@ -251,7 +251,8 @@ lowranceusr_fread(void *buff, size_t size, size_t members, FILE * fp) br = fread(buff, size, members, fp); if (br != members) { - fatal(MYNAME ": requested to read %d bytes, read %d bytes.\n", members, br); + fatal(MYNAME ": requested to read %lu bytes, read %lu bytes.\n", + (unsigned long) members, (unsigned long) br); } return (br); diff --git a/magproto.c b/magproto.c index 9b92905bb..18fd72115 100644 --- a/magproto.c +++ b/magproto.c @@ -955,7 +955,8 @@ void parse_istring(char *istring) int f = 0; int n,x; while (istring[0]) { - x = sscanf(istring, "%[^,]%n", &ifield[f], &n); + char *fp = ifield[f]; + x = sscanf(istring, "%[^,]%n", fp, &n); f++; if (x) { istring += n; diff --git a/mapsource.c b/mapsource.c index dfadfee0d..08ab2f142 100644 --- a/mapsource.c +++ b/mapsource.c @@ -422,7 +422,8 @@ mps_mapsegment_r(FILE *mps_file, int mps_ver) { int reclen; - /* At the moment we're not doing anything with map segments, but here's the template code as if we were +#if 0 + /* At the moment we're not doing anything with map segments, but here's the template code as if we were */ char hdr[100]; fread(&CDid, 4, 1, mps_file); reclen = le_read32(&CDid); @@ -435,6 +436,7 @@ mps_mapsegment_r(FILE *mps_file, int mps_ver) mps_readstr(mps_file, CDAreaName, sizeof(CDAreaName)); fread(hdr, 4, 1, mps_file); /* trailing long value */ +#endif fseek(mps_file, -5, SEEK_CUR); fread(&reclen, 4, 1, mps_file); @@ -611,7 +613,7 @@ mps_waypoint_w(FILE *mps_file, int mps_ver, const waypoint *wpt, const int isRou int reclen; int lat, lon; int icon; - char *src; + char *src = ""; /* default to empty string */ char *ident; char *ascii_description; char zbuf[25]; @@ -1139,11 +1141,11 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte) char *rname; char hdr[20]; char zbuf[20]; - char *src; + char *src = ""; char *ident; waypoint *testwpt; - time_t uniqueValue; + time_t uniqueValue = 0; int allWptNameLengths; double maxlat=-90.0; @@ -1199,7 +1201,7 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte) /* route name */ if (!rte->rte_name) { - sprintf(hdr, "Route%04x", uniqueValue); + sprintf(hdr, "Route%04x", (unsigned) uniqueValue); rname = xstrdup(hdr); } else @@ -1304,7 +1306,7 @@ mps_routedatapoint_w(FILE *mps_file, int mps_ver, const waypoint *rtewpt) int lon; char zbuf[20]; char ffbuf[20]; - char *src; + char *src = ""; char *ident; int reclen; @@ -1611,7 +1613,7 @@ mps_trackhdr_w(FILE *mps_file, int mps_ver, const route_head *trk) char *tname; char hdr[20]; waypoint *testwpt; - time_t uniqueValue; + time_t uniqueValue = 0; queue *elem, *tmp; @@ -1632,7 +1634,7 @@ mps_trackhdr_w(FILE *mps_file, int mps_ver, const route_head *trk) /* track name */ if (!trk->rte_name) { - sprintf(hdr, "Track%04x", uniqueValue); + sprintf(hdr, "Track%04x", (unsigned) uniqueValue); tname = xstrdup(hdr); } else @@ -1867,7 +1869,8 @@ mps_write(void) char recType; int reclen; - int reclen2; + /* TODO: This kills a compiler warning but I'm not sure it's right */ + int reclen2 = 0; unsigned int tocopy; unsigned int block; diff --git a/msroute.c b/msroute.c index f28d3b255..eadc4a8c8 100644 --- a/msroute.c +++ b/msroute.c @@ -158,19 +158,6 @@ static int ole_root_sec_ct; /* local helpers */ -static void -print_buff(const char *buff, int count, const char *comment) -{ - int i; - printf(MYNAME ": dump of %s : ", comment); - for (i = 0; i < count; i++) - { - printf("%02x ", buff[i] & 0xFF); - } - printf("\n"); - fflush(stdout); -} - static void le_read32_buff(int *buff, const int count) { @@ -381,7 +368,9 @@ ole_init(void) sector_size = 512; /* fixed for the moment */ - is_fatal((sizeof(head) != sector_size), MYNAME ": (!) internal error - invalid header size (%d)!", sizeof(head)); + is_fatal((sizeof(head) != sector_size), + MYNAME ": (!) internal error - invalid header size (%lu)!", + (unsigned long) sizeof(head)); memset(&head, 0, sizeof(head)); fread(&head, sizeof(head), 1, fin); diff --git a/msvc/GPSBabel.vcproj b/msvc/GPSBabel.vcproj index e233aae5b..2ec9b9b65 100644 --- a/msvc/GPSBabel.vcproj +++ b/msvc/GPSBabel.vcproj @@ -1,1857 +1,2390 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/msvc/config.h b/msvc/config.h index 4fd8d980c..53a7498c3 100644 --- a/msvc/config.h +++ b/msvc/config.h @@ -18,5 +18,5 @@ #undef PDBFMTS_ENABLED /* 1 to enable shapefile support */ -#undef SHAPELIB_ENABLED 1 +#undef SHAPELIB_ENABLED diff --git a/navicache.c b/navicache.c index de50e7f8a..43df0755d 100644 --- a/navicache.c +++ b/navicache.c @@ -230,7 +230,7 @@ nav_read(void) while ((len = fread(buf, 1, sizeof(buf), fd))) { if (!XML_Parse(psr, buf, len, feof(fd))) { fatal(MYNAME ":Parse error at %d: %s\n", - XML_GetCurrentLineNumber(psr), + (int) XML_GetCurrentLineNumber(psr), XML_ErrorString(XML_GetErrorCode(psr))); } } diff --git a/pathaway.c b/pathaway.c index b59a85c4b..d68193715 100644 --- a/pathaway.c +++ b/pathaway.c @@ -76,7 +76,8 @@ static arglist_t ppdb_args[] = ARG_TERMINATOR }; -#undef PPDB_DEBUG +/*#undef PPDB_DEBUG*/ +#define PPDB_DEBUG 1 #if PPDB_DEBUG static void @@ -95,9 +96,9 @@ internal_debug2(const char *format, ... ) puts(""); va_end(args); } -#define DBG internal_debug1(__FILE__, __LINE__);internal_debug2 +#define DBG(args) internal_debug1(__FILE__, __LINE__);internal_debug2 args #else -#define DBG ; +#define DBG(args) ; #endif @@ -622,7 +623,7 @@ static void ppdb_write_wpt(const waypoint *wpt) if (global_opts.synthesize_shortnames != 0) { tmp = mkshort_from_wpt(mkshort_handle, wpt); - DBG("shortname %s from %s", tmp, wpt->shortname); + DBG(("shortname %s from %s", tmp, wpt->shortname)); } else { diff --git a/polygon.c b/polygon.c index c19488d92..7b0eeacd5 100644 --- a/polygon.c +++ b/polygon.c @@ -96,6 +96,10 @@ static void polytest ( double lat1, double lon1, else { if ( lon1 <= wlon && lon2 > wlon ) { if ( *state & UP ) { + /* TODO: I assume this intends to set LIMBO_UP and + * clear UP - but & has higher precendence so it + * actually leaves *state unaltered. + */ *state = *state | LIMBO_UP & ~UP; } *state = *state | LIMBO; @@ -108,6 +112,10 @@ static void polytest ( double lat1, double lon1, if ( !(*state & LIMBO_UP) ) { *state = *state ^ INSIDE; } + /* TODO: I assume this intends to set LIMBO_UP and + * clear UP - but & has higher precendence so it + * actually leaves *state unaltered. + */ *state = *state & ~LIMBO & ~LIMBO_UP; } else if (*state & LIMBO_BEGIN) { diff --git a/position.c b/position.c index c9b12d9e7..d451710c9 100644 --- a/position.c +++ b/position.c @@ -287,7 +287,7 @@ radius_process(void) waypoint ** comp; int i, wc; queue temp_head; - route_head *rte_head; + route_head *rte_head = NULL; QUEUE_FOR_EACH(&waypt_head, elem, tmp) { extra_data *ed; diff --git a/psitrex.c b/psitrex.c index 3eda2eb45..624433417 100755 --- a/psitrex.c +++ b/psitrex.c @@ -208,7 +208,7 @@ psit_wr_deinit(void) static void psit_getToken(FILE *psit_file, char *buf, size_t sz, psit_tokenSep_type delimType) { - int c; + int c = -1; *buf = 0; @@ -458,7 +458,7 @@ psit_routehdr_w(FILE *psit_file, const route_head *rte) char *rname; waypoint *testwpt; - time_t uniqueValue; + time_t uniqueValue = 0; int allWptNameLengths; queue *elem, *tmp; @@ -482,7 +482,7 @@ psit_routehdr_w(FILE *psit_file, const route_head *rte) /* route name */ if (!rte->rte_name) { - sprintf(hdr, "Route%04x", uniqueValue); + sprintf(hdr, "Route%04x", (unsigned) uniqueValue); rname = xstrdup(hdr); } else @@ -514,7 +514,7 @@ psit_track_r(FILE *psit_file, route_head **trk) struct tm tmTime; time_t dateTime = 0; - route_head *track_head; + route_head *track_head = NULL; unsigned int trk_count; waypoint *thisWaypoint; @@ -613,7 +613,7 @@ psit_trackhdr_w(FILE *psit_file, const route_head *trk) unsigned int trk_datapoints; char *tname; waypoint *testwpt; - time_t uniqueValue; + time_t uniqueValue = 0; queue *elem, *tmp; @@ -635,7 +635,7 @@ psit_trackhdr_w(FILE *psit_file, const route_head *trk) /* track name */ if (!trk->rte_name) { - sprintf(hdr, "Track%04x", uniqueValue); + sprintf(hdr, "Track%04x", (unsigned) uniqueValue); tname = xstrdup(hdr); } else diff --git a/psp.c b/psp.c index 120853078..76298718e 100644 --- a/psp.c +++ b/psp.c @@ -42,7 +42,8 @@ psp_fread(void *buff, size_t size, size_t members, FILE * fp) br = fread(buff, size, members, fp); if (br != members) { - fatal(MYNAME ": requested to read %d bytes, read %d bytes.\n", members, br); + fatal(MYNAME ": requested to read %ld bytes, read %ld bytes.\n", + (unsigned long) members, (unsigned long) br); } return (br); diff --git a/quovadis.c b/quovadis.c index cefa44d8e..745c151ec 100644 --- a/quovadis.c +++ b/quovadis.c @@ -198,8 +198,8 @@ quovadis_writewpt(waypoint *wpt) xfree(rec); if (rec_index == MAXRECORDS) { - fatal(MYNAME ": cannot store more than %d records at this time.\n", - MAXRECORDS); + fatal(MYNAME ": cannot store more than %lu records at this time.\n", + (unsigned long) MAXRECORDS); } } diff --git a/shape.c b/shape.c index 4d4c03d52..fdfe2cf02 100644 --- a/shape.c +++ b/shape.c @@ -119,7 +119,7 @@ my_read(void) while (npts) { SHPObject *shp; waypoint *wpt; - const char *name; + const char *name = ""; const char *url; char *tmpName = NULL; char *tmpIndex = opt_name; diff --git a/shapelib/dbfopen.c b/shapelib/dbfopen.c index 830a5be71..600271092 100644 --- a/shapelib/dbfopen.c +++ b/shapelib/dbfopen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: dbfopen.c,v 1.2 2006/05/07 02:14:35 robertl Exp $ + * $Id: dbfopen.c,v 1.3 2006/07/13 03:27:54 robertl Exp $ * * Project: Shapelib * Purpose: Implementation of .dbf access API documented in dbf_api.html. @@ -34,6 +34,10 @@ ****************************************************************************** * * $Log: dbfopen.c,v $ + * Revision 1.3 2006/07/13 03:27:54 robertl + * Andy Armstrong turns on -Wall for GCC builds and kills about a sequillion warnings. Most of them aren't "real", but it's still a good thing to clean up. + * (I hope I don't regret this before 1.3.1...) + * * Revision 1.2 2006/05/07 02:14:35 robertl * Make shapefile and all palm pdb formats deselectable at build time. * @@ -188,8 +192,8 @@ * Added header. */ -static char rcsid[] = - "$Id: dbfopen.c,v 1.2 2006/05/07 02:14:35 robertl Exp $"; +/*static char rcsid[] = + "$Id: dbfopen.c,v 1.3 2006/07/13 03:27:54 robertl Exp $";*/ #include "shapefil.h" #include "config.h" diff --git a/shapelib/shpopen.c b/shapelib/shpopen.c index 711991816..9e75ec7d1 100644 --- a/shapelib/shpopen.c +++ b/shapelib/shpopen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: shpopen.c,v 1.3 2006/05/07 02:14:35 robertl Exp $ + * $Id: shpopen.c,v 1.4 2006/07/13 03:27:54 robertl Exp $ * * Project: Shapelib * Purpose: Implementation of core Shapefile read/write functions. @@ -34,6 +34,10 @@ ****************************************************************************** * * $Log: shpopen.c,v $ + * Revision 1.4 2006/07/13 03:27:54 robertl + * Andy Armstrong turns on -Wall for GCC builds and kills about a sequillion warnings. Most of them aren't "real", but it's still a good thing to clean up. + * (I hope I don't regret this before 1.3.1...) + * * Revision 1.3 2006/05/07 02:14:35 robertl * Make shapefile and all palm pdb formats deselectable at build time. * @@ -167,8 +171,8 @@ * */ -static char rcsid[] = - "$Id: shpopen.c,v 1.3 2006/05/07 02:14:35 robertl Exp $"; +/*static char rcsid[] = + "$Id: shpopen.c,v 1.4 2006/07/13 03:27:54 robertl Exp $";*/ #include "shapefil.h" #include "config.h" diff --git a/strptime.c b/strptime.c index 968934ff6..7d56a1539 100644 --- a/strptime.c +++ b/strptime.c @@ -551,11 +551,13 @@ strptime_internal (rp, fmt, tm, decided, era_cnt) *decided = raw; } #endif - if (!match_string (HERE_AM_STR, rp)) - if (match_string (HERE_PM_STR, rp)) + if (!match_string (HERE_AM_STR, rp)) { + if (match_string (HERE_PM_STR, rp)) { is_pm = 1; - else + } else { return NULL; + } + } break; case 'r': #ifdef _NL_CURRENT diff --git a/tpg.c b/tpg.c index 49ce1d4cc..f1f7715c9 100644 --- a/tpg.c +++ b/tpg.c @@ -54,7 +54,8 @@ tpg_fread(void *buff, size_t size, size_t members, FILE * fp) br = fread(buff, size, members, fp); if (br != members) { - fatal(MYNAME ": requested to read %d bytes, read %d bytes.\n", members, br); + fatal(MYNAME ": requested to read %lu bytes, read %lu bytes.\n", + (unsigned long) members, (unsigned long) br); } return (br); diff --git a/tpo.c b/tpo.c index d1df83e92..b3bc3ff08 100644 --- a/tpo.c +++ b/tpo.c @@ -663,6 +663,8 @@ void tpo_process_tracks(void) int lonscale; int latscale; int waypoint_count = 0; + int lat = 0; + int lon = 0; unsigned int jj; route_head* track_temp; @@ -723,10 +725,7 @@ void tpo_process_tracks(void) llvalid = 0; for (jj = 0; jj < track_byte_count; ) { waypoint* waypoint_temp; - int lat; - int lon; - // Time to read a new latlong? if (!llvalid) { diff --git a/unicsv.c b/unicsv.c index 46220691a..1deddd8e3 100644 --- a/unicsv.c +++ b/unicsv.c @@ -164,8 +164,8 @@ unicsv_parse_one_line(char *ibuf) waypoint *wpt; int i; int utmz = -9999; - double utme; - double utmn; + double utme = 0; + double utmn = 0; s = csv_lineparse(ibuf, unicsv_fieldsep, "\"", 0); if (s == NULL) return; diff --git a/util.c b/util.c index 4ce933aa7..895dcfabc 100644 --- a/util.c +++ b/util.c @@ -75,7 +75,7 @@ xmalloc(size_t size) obj, size, file, line ); #endif if (!obj) { - fatal("gpsbabel: Unable to allocate %d bytes of memory.\n", size); + fatal("gpsbabel: Unable to allocate %ld bytes of memory.\n", (unsigned long) size); } return obj; @@ -95,7 +95,7 @@ xcalloc(size_t nmemb, size_t size) #endif if (!obj) { - fatal("gpsbabel: Unable to allocate %d bytes of memory.\n", size); + fatal("gpsbabel: Unable to allocate %ld bytes of memory.\n", (unsigned long) size); } return obj; @@ -129,7 +129,7 @@ xstrdup(const char *s) #endif if (!o) { - fatal("gpsbabel: Unable to allocate %d bytes of memory.\n", strlen(s)); + fatal("gpsbabel: Unable to allocate %ld bytes of memory.\n", (unsigned long) strlen(s)); } return o; @@ -203,7 +203,7 @@ xrealloc(void *p, size_t s) #endif if (!o) { - fatal("gpsbabel: Unable to realloc %d bytes of memory.\n", s); + fatal("gpsbabel: Unable to realloc %ld bytes of memory.\n", (unsigned long) s); } return o; @@ -898,7 +898,7 @@ xstrrstr(const char *s1, const char *s2) { char *r = NULL, *next = NULL; - while (next = strstr(s1, s2)) { + while (next = strstr(s1, s2), NULL != next) { r = next; s1 = next + 1; } @@ -1130,32 +1130,32 @@ strip_nastyhtml(const char * in) sp = returnstr = xstrdup(in); lcp = lcstr = strlower(xstrdup(in)); - while (lcp = strstr(lcstr, "")) { + while (lcp = strstr(lcstr, ""), NULL != lcp) { sp = returnstr + (lcp - lcstr) ; /* becomes --> */ *sp++ = ' '; *sp++ = ' '; *sp++ = ' '; *sp++ = ' '; *sp++ = ' '; *sp++ = '-'; *sp++ = '-'; *lcp = '*'; /* so we wont find it again */ } - while (lcp = strstr(lcstr, " 0) { - db(3, "%02x ", *dd++); - } - db(3, "\n"); -} - static void rd_buf(void *buf, int len) { char *bp = buf; @@ -220,9 +212,9 @@ static void data_read(void) { */ char line_buf[100]; int count, d; - gbuint32 tim, ptim; + gbuint32 tim, ptim = 0; double lat, lon; - double plat, plon; /* previous point */ + double plat = 0, plon = 0; /* previous point */ struct tm t; time_t rtim; route_head *route_head = NULL; diff --git a/wfff_xml.c b/wfff_xml.c index d20bd16c3..a8177a581 100644 --- a/wfff_xml.c +++ b/wfff_xml.c @@ -273,7 +273,7 @@ wfff_xml_rd_deinit(void) xml_deinit(); if (tosscount) { - warning("Warning: %s reading file. Threw away %d invalid entries.\n", + warning("Warning: %s reading file. Threw away %ld invalid entries.\n", MYNAME, tosscount ); } diff --git a/xmlgeneric.c b/xmlgeneric.c index 235524291..edd478f4c 100644 --- a/xmlgeneric.c +++ b/xmlgeneric.c @@ -262,7 +262,7 @@ void xml_read(void) while ((len = fread(buf, 1, sizeof(buf), ifd))) { if (!XML_Parse(psr, buf, len, feof(ifd))) { fatal(MYNAME ":Parse error at %d: %s\n", - XML_GetCurrentLineNumber(psr), + (int) XML_GetCurrentLineNumber(psr), XML_ErrorString(XML_GetErrorCode(psr))); } } @@ -275,7 +275,7 @@ void xml_readstring( char *str ) int len = strlen(str); if (!XML_Parse(psr, str, len, 1)) { fatal( MYNAME ":Parse error at %d: %s\n", - XML_GetCurrentLineNumber(psr), + (int) XML_GetCurrentLineNumber(psr), XML_ErrorString(XML_GetErrorCode(psr))); } XML_ParserFree(psr); diff --git a/yahoo.c b/yahoo.c index 367f5c00d..8a98668fd 100644 --- a/yahoo.c +++ b/yahoo.c @@ -36,7 +36,7 @@ arglist_t yahoo_args[] = { }; static xg_callback wpt_s, wpt_lat, wpt_lon, wpt_e; -static xg_callback wpt_addr, wpt_city, wpt_state, wpt_zip, wpt_country; +static xg_callback wpt_addr /*, wpt_city, wpt_state, wpt_zip, wpt_country*/; static xg_tag_mapping gl_map[] = { { wpt_s, cb_start, "/ResultSet/Result" }, -- 2.30.2